﻿Type=Activity
Version=3.15
@EndOfDesignText@
#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.
	
	Dim V_XM As String
	Dim V_CH As String
	Dim V_BHID As Int

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.

	Dim lsvYZ As ListView
	
End Sub

Sub Activity_Create(FirstTime As Boolean)
	Activity.LoadLayout("FormBHYZInfo")
	Activity.Title = "病人医嘱信息-"  & V_CH & " " &V_XM 
	
	InitLayOut

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub InitLayOut
	lsvYZ.AddSingleLine2("当天医嘱",0)
	lsvYZ.AddSingleLine2("最近3天医嘱",3)
	lsvYZ.AddSingleLine2("最近7天医嘱",7)
	lsvYZ.AddSingleLine2("全部医嘱",-1)
	
	'lsvYZ.TwoLinesLayout.Label.TextSize = 25
'	lsvYZ.TwoLinesLayout.ItemHeight = 100
	lsvYZ.FastScrollEnabled = True
	
	'高级菜单
	'Activity.AddMenuItem("住院/门诊号","MenuItemAdv")
	'Activity.AddMenuItem("姓名","MenuItemAdv")
	'Activity.AddMenuItem("设置","MenuItemAdv")
	
	'Activity.AddMenuItem("登陆科室","MenuItemAdv")
End Sub

Sub lsvYZ_ItemClick (Position As Int, Value As Object)
	Dim iTS As Int
	BHYZList.V_BHID = V_BHID
	BHYZList.V_XM = V_XM	
	BHYZList.V_CH = V_CH	
	BHYZList.V_KSRQ = ""
	BHYZList.V_JSRQ = ""
	
	iTS = Value
	If iTS > -1 Then
		DateTime.DateFormat = "yyyyMMdd"  '月是M，大写
		BHYZList.V_JSRQ = DateTime.Date(DateTime.Now)
		BHYZList.V_KSRQ = DateTime.Date(DateTime.Now - DateTime.TicksPerDay * iTS)

	End If
	
	Select iTS
		Case 0
			BHYZList.V_YZFW = "当天医嘱"	
		Case 3
			BHYZList.V_YZFW = "最近3天医嘱"
		Case 7
			BHYZList.V_YZFW = "最近7天医嘱"
		Case -1
			BHYZList.V_YZFW = "全部医嘱"
			
	End Select
	
	StartActivity("BHYZList")  

End Sub


